package topology;

import org.apache.storm.trident.operation.BaseFunction;
import org.apache.storm.trident.operation.TridentCollector;
import org.apache.storm.trident.tuple.TridentTuple;
import org.apache.storm.tuple.Values;



public class IpTranNumBolt extends BaseFunction {
    String num;

    @Override
    public void execute(TridentTuple tuple, TridentCollector collector) {
        String ip=tuple.getString(0);
        String[] ip_shuzu= ip.split(".");

        for (int i=0;i< ip_shuzu.length;i++) {
            num=num+ip_shuzu[i];
        }
        int number=Integer.parseInt(num);

        collector.emit(new Values(number));
    }
}
